package ee.rsi2m.goproject.model;

import java.util.LinkedList;
import java.util.List;

import android.graphics.Point;

public
class GoGameInfo
{
	int boardSize = 9;

	int level = 1;

	int handicap = 0;

	String komi = "5.5";

	boolean chineseRules = false;

	String sgfFileName;

	String sgfComment;

	boolean
		playerBlackHuman = true,
		playerWhiteHuman = false;

	boolean
		playerBlackMoves = true,
		playerBlackPassed = false,
		playerWhitePassed = false;

	final LinkedList <Point> moveHistory = new LinkedList<Point>();

	int moveHistoryOffset = 0;

	boolean invalid = false;

	Point getLastMove ()
	{
		final List <Point> moveHistory = this.moveHistory;
		if (moveHistory.size () == 0)
		{
			return null;
		}
		return moveHistory.get (moveHistory.size () - moveHistoryOffset -1);
	}

	void resetMoveHistory ()
	{
		final LinkedList <Point> moveHistory = this.moveHistory;
		for (int historySize = moveHistoryOffset; historySize > 0;
			historySize--)
		{
			moveHistory.removeLast ();
		}
		moveHistoryOffset = 0;
	}
}